package nextoffer.baidu;

import java.util.Scanner;

/**
 * 一个数组arr =[1,5,3,4,2]
 * 交换位置 一个长度为k的连续子数组   最多一次交换 找到交换的位置   排列 1,2,3,4
 */
public class Se {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别

            int n = in.nextInt();
            int k = in.nextInt();
         int arr[ ] = new int[n];
        int dp[] = new int[n];
        dp[0] = 1;//代表 下标0有序长度是1
        for (int i = 0; i < n; i++) {
            arr[i] = in.nextInt();

        }

        for(int i = 0; i < n;i++) {
            for(int j = i + 1; j < n; j++) {
                boolean check1 = check(arr, k);
                if(check1 == true) {
                    System.out.println("YES\n" +
                            "0\n");
                    return;
                }
                swap(arr, i ,j);
//                System.out.println(arr);
                boolean check = check(arr, k);
                if(check == true) {
                    System.out.println("YES\n" +
                            "1\n" +
                             + (i + 1 ) + " " + (j + 1));
                    return;
                }
                swap(arr, i ,j);
            }
        }

        System.out.println("NO");

    }

    public static boolean check(int[] arr,int k ) {
       int flag = 0 ;
       int cnt = 1 ;
       flag = arr[0] == 1 ? 1 : 0;
        for(int i = 1; i < arr.length;i++){
            if(arr[i] == 1) {
                flag = 1;
                cnt = 1;
                continue;
            }
            if(arr[i] == arr[i - 1 ] + 1 && flag ==  1){
                cnt ++;
                if(cnt>=k) return true;
            }
            if(arr[i] != arr[i - 1 ] + 1) {
                flag = 0;
                cnt = 0;
            }
        }
        return false;
    }

    public static void swap(int[] arr, int left, int right) {
        int t = arr[left] ; arr[left]  = arr[right]; arr[right] = t;
    }
}
